package com.provider.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.api.service.DemoService;
import com.entity.po.User;
import org.apache.dubbo.config.annotation.DubboService;


import java.util.ArrayList;
import java.util.List;

/**
 * @Author: lc
 * @Date: 2021/11/28 23:56
 */
//需要暴露的服务接口
@DubboService(version = "1.0.0",timeout = 3000)
public class DemoServiceImpl implements DemoService {

    public String sayHello(String name) {
        return "Hello " + name;
    }
    public List getUsers() {
        List list = new ArrayList();
        User u1 = new User();
        u1.setName("jack");
        u1.setAge(20);
        u1.setSex("男");

        User u2 = new User();
        u2.setName("tom");
        u2.setAge(21);
        u2.setSex("女");

        User u3 = new User();
        u3.setName("rose");
        u3.setAge(19);
        u3.setSex("女");

        list.add(u1);
        list.add(u2);
        list.add(u3);
        return list;
    }
}
